package cn.bearspark.file.provider.rpc;

import cn.bearspark.file.provider.service.FileService;
import cn.bearspark.file.rpc.FileRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author f
 */
@Component
@DubboService
public class FileRpcImpl implements FileRpc {

    private final FileService fileService;

    public FileRpcImpl(FileService fileService) {
        this.fileService = fileService;
    }

    @Override
    public void prepareDeletion(String filename, int moduleCode) {
        fileService.prepareDeletion(filename, moduleCode);
    }

    @Override
    public void preventDeletion(List<String> urlList) {
        fileService.preventDeletion(urlList);
    }

    @Override
    public void onFileDeadline(List<String> filenameList) {
        fileService.onFileDeadline(filenameList);
    }

    @Override
    public void deleteBatch(List<String> urlList) {
        fileService.deleteBatch(urlList);
    }
}
